<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="springform"
	uri="http://www.springframework.org/tags/form"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<jsp:include page="/WEB-INF/views/webPart/head.jsp"></jsp:include>

<title>代码生成器 for zsoft - 呵Sever</title>
<script type="text/javascript">
	function showTab(item){
		$("div[name='tabMain']").each(function(){
			$(this).hide();
		});
		$("li[name='tabSelect']").each(function(){
			$(this).attr("class","");
		});
		
		$("#"+item).show();
		$("#"+item+"Select").attr("class","active");
	}
	$(function(){
		$("#form").submit(function(){
			if($("#design").val()==""){
				$("#myModalLabel").html("消息提示");
				$("#myModalContent").html("抱歉，类设计不能为空！");
				$('#myModal').modal('show');
				$('#myModal').on('hidden.bs.modal', function () {
					$('#design').focus();
				});
				return false;
			}
		});
	});
</script>
<style type="text/css">
textarea {
	width: 100%;
	font-size: 13px;
	font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
	overflow-y: visible;
}

div[name='tabMain'] {
	display: none;
}
</style>
</head>
<body>
	<jsp:include page="/WEB-INF/views/webPart/top.jsp"></jsp:include>
	<jsp:include page="/WEB-INF/views/webPart/left.jsp"></jsp:include>
	<div class="mycol col-md-9 col-xs-11">
		<div class="main">
			<jsp:include page="/WEB-INF/views/pub/tools/webpart/breadcrumb.jsp">
				<jsp:param value="代码生成器 for zsoft" name="breadcrumbName"/>
			</jsp:include>
			<div class="mainItem">
				<h3>代码生成器（zsoft专版） by 呵Sever</h3>
				<form action="${context }/pub/tools/view/CodeGeneraterForZsoft"
					method="post" id="form">
					类名：<input type="text" name="className" placeholder="类名"
						value="${className }"><br> 表名：<input type="text"
						name="tableName" placeholder="数据库表名" value="${tableName }"><br>
					<br> <span style="color: red;">*</span>类设计（属性 类型 长度 可空
					说明），无内容请用“-”表示：<br>
					<textarea id="design" name="design"
						class="jq_watermark form-control" rows="10"
						placeholder="实例：<br/>name String 2000 是 名称<br/>date Date - 是  日期">${design }</textarea>
					<br>
					<br>
					<div style="text-align: right;">
						<button class="btn btn-primary">提交</button>
					</div>
				</form>
				<ul class="nav nav-tabs">
					<li class="active" id="javaCodeSelect" name="tabSelect"><a
						href="javascript:showTab('javaCode')">JAVA代码</a></li>
					<li class="" id="sqlCodeSelect" name="tabSelect"><a
						href="javascript:showTab('sqlCode')">数据库脚本SQL</a></li>
				</ul>
				<div id="javaCode" style="display: block;" name="tabMain">
					Domain类
					<textarea style="height: 500px;" class="form-control" readonly>${domainCode }</textarea>
					Repository类
					<textarea style="height: 120px;" class="form-control" readonly>${repositoryCode }</textarea>
					Service类
					<textarea style="height: 120px;" class="form-control" readonly>${serviceCode }</textarea>
					ServiceImpl类
					<textarea style="height: 120px;" class="form-control" readonly>${serviceImplCode }</textarea>
				</div>
				<div id="sqlCode" name="tabMain">
					oracle建表sql，"【】"中的内容请自行补充
					<textarea style="height: 500px;" class="form-control" readonly>${oracleCreateCode }</textarea>
				</div>
			</div>
			<div class="mainItem">
				<b>历史版本：</b><br> 
				<b>v1.2.1(20150122)</b> 修复数据库脚本生成错误的bug<br>
				v1.2.0(20150105) 类设计为空提示（使用模态框）<br>
				v1.1.0(20141210) oracle数据库建表脚本生成。<br>
				v1.0.0(20141203) 根据代码设计生成java代码。<br>
				<br> <b>未来版本计划支持：</b><br> java基本数据类型小写；<br>
				不同数据库脚本生成；<br>
			</div>
		</div>
	</div>
	<jsp:include page="/WEB-INF/views/webPart/right.jsp"></jsp:include>
	<jsp:include page="/WEB-INF/views/webPart/footer.jsp"></jsp:include>

</body>
</html>